<html>
<head><meta charset="utf-8"><title>Unhelpful/wrong compiler error · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html">Unhelpful/wrong compiler error</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="170903432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Unhelpful/wrong%20compiler%20error/near/170903432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Francesco Dainese <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html#170903432">(Jul 15 2019 at 15:27)</a>:</h4>
<p>Hello everyone.<br>
Today I was trying to implement an extremely simple executor for futures, when I stumbled upon a confusing compiler error.<br>
Cargo was telling me that my <code>F: Future</code> type wasn't implementing <code>poll</code>, or that I should import <code>std::future::Future</code>, as seen here: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=c3e73222132e8f6a58330ae926ec055c" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=c3e73222132e8f6a58330ae926ec055c">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=c3e73222132e8f6a58330ae926ec055c</a></p>
<p>The problem is that the error is instead due to the fact that <code>poll</code> expects a <code>Pin</code>, as seen here: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=51fa7ab7533890fb8190525d973fcc10" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=51fa7ab7533890fb8190525d973fcc10">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=51fa7ab7533890fb8190525d973fcc10</a><br>
Since, after putting my future inside a <code>Pin</code>, it compiled (and run) succesfully.</p>



<a name="171439322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Unhelpful/wrong%20compiler%20error/near/171439322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Francesco Dainese <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html#171439322">(Jul 22 2019 at 15:17)</a>:</h4>
<p>I wanted to get this under the team eyes, both to get some clarification if that's intended or not and how (if) to proceed in making this error clearer. It's been a week now and I haven't heard from anyone...</p>



<a name="171439709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Unhelpful/wrong%20compiler%20error/near/171439709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html#171439709">(Jul 22 2019 at 15:21)</a>:</h4>
<p>I agree that the error message isn't maximally useful. The actual implementation of <em>how</em> I can't help with. Conceptually, it seems like you might want to search through the possible self receivers and see if any of them implement the trait. However, this seems like a large space to search through.</p>



<a name="171440031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Unhelpful/wrong%20compiler%20error/near/171440031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html#171440031">(Jul 22 2019 at 15:25)</a>:</h4>
<p><span class="user-mention" data-user-id="230304">@Francesco Dainese</span> since you did not get a response here, creating an issue on the tracker seems reasonable. that does not guarantee anything but it is at least less ephemeral than Zulip.<br>
Cc <span class="user-group-mention" data-user-group-id="1172">@WG-async-foundations</span></p>



<a name="171440408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Unhelpful/wrong%20compiler%20error/near/171440408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html#171440408">(Jul 22 2019 at 15:29)</a>:</h4>
<p>And <span class="user-group-mention" data-user-group-id="1187">@WG-diagnostics</span></p>



<a name="172783903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Unhelpful/wrong%20compiler%20error/near/172783903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Unhelpful.2Fwrong.20compiler.20error.html#172783903">(Aug 08 2019 at 17:17)</a>:</h4>
<p>Misleading diagnostics are certainly treated as bugs. Feel free to file a ticket as advised above.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>